<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>视频类型</title>
<link rel="stylesheet"
	href="../common/kindeditor-4.1.10/themes/default/default.css" />
<script charset="utf-8"
	src="../common/kindeditor-4.1.10/kindeditor-min.js"></script>
<script charset="utf-8" src="../common/kindeditor-4.1.10/lang/zh_CN.js"></script>
<%@ include file="../common/importLib.jsp"%>
<script type="text/javascript">
	/**
	 * 增删改查参数设置
	 */
	tableTitle = "视频类型表";
	tableURL = getTimeURL("videoType/queryPage.do");
	toolbarView = 4;
	tableColumns = [ [
			{
				field : 'ck',
				checkbox : true
			},
			{
				field : 'id',
				title : 'id',
				width : 0,
				rowspan : 1
			},
			{
				field : 'typeName',
				title : '视频类型名字',
				width : 200,
				rowspan : 1
			},
			{
				field : 'disableFlag',
				title : '禁用状态',
				width : 80,
				align : 'center',
				rowspan : 1,
				formatter : function(value, rowData, rowIndex) {
					if (rowData.disableFlag == 0) {
						return "<font color='green'>起用</font>";
					} else {
						return "<font color='red'>禁用</font>";
					}
				}
			},
			{
				field : 'opt',
				title : '操作',
				width : 80,
				align : 'center',
				rowspan : 1,
				formatter : function(value, rowData, rowIndex) {
					var queryUrl = 'videoType/queryById.do?id=' + rowData.id;
					return "<a title='修改' class='xxl_linkbutton' iconCls='icon-edit' href='javascript:datagridUpdate(\""
							+ queryUrl + "\")'>修改</a>";
				}
			} ] ];

	var addWidth = 800; //添加窗口宽度
	var addHeight = 550; //添加窗口高度
	var addTitle = "添加视频类型"; //添加标题
	var updateWidth = 800; //修改窗口宽度
	var updateHeight = 550; //修改窗口高度
	var updateTitle = "修改视频类型"; //修改标题
	var updateDisableFlagUri = "videoType/updateDisableFlag.do"; //禁用、起用记录
	var deleteUri = "videoType/deleteByIds.do"; //删除记录

	/**
	 * 初始化添加表单
	 */
	function initAddForm() {
		addFormProcess("typeName", "视频类型名", true);
		baseFormValidator("typeName", "视频类型名", 1, 20);
	}

	/**
	 * 初始化修改表单
	 */
	function initUpdateForm(jsonObject) {
		//selectRadio(jsonObject.sex,"datagrid_update");
		$("#idUpdate").val(jsonObject.id);
		$("#typeNameUpdate").val(jsonObject.typeName);
		$("#typeDescUpdate").val(jsonObject.typeDesc);
		updateFormProcess("typeNameUpdate", "视频类型名");
		baseFormValidator("typeNameUpdate", "视频类型名", 1, 20);
	}
</script>
</head>
<body id="layout" class="easyui-layout">
	<div region="center">
		<!-- datagrid信息表 -->
		<table id="datagrid_table"></table>
		<!-- 添加记录 -->
		<div id="datagrid_add">
			<form id="add_form" action="videoType/insert.do"
				method="post" style="padding: 20px;">
				<table width="100%" class="xxl_tb_1">
					<tbody>
						<tr>
							<td class="xxl_td_2">视频类型名：</td>
							<td><input type="text" id="typeName" name="typeName" /></td>
							<td><div id="typeNameTip" style="width: 250px"></div></td>
						</tr>

						<tr>
							<td colspan="3" style="text-align: center"><a
								class="easyui-linkbutton" iconCls="icon-ok"
								onclick="$('#add_form').submit();">添加</a> <a
								class="easyui-linkbutton" iconCls="icon-undo"
								onclick="document.getElementById('add_form').reset()">重置</a> <a
								class="easyui-linkbutton" iconCls="icon-cancel"
								onclick="$('#datagrid_add').window('close');">取消</a></td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>

		<!-- 修改记录 -->
		<div id="datagrid_update">
			<form id="update_form" action="videoType/updateById.do"
				method="post" style="padding: 20px;">
				<input type="hidden" id="idUpdate" name="id" />
				<table width="100%" class="xxl_tb_1">
					<tbody>
						<tr>
							<td class="xxl_td_2">视频类型名：</td>
							<td><input type="text" id="typeNameUpdate" name="typeName" /></td>
							<td><div id="typeNameUpdateTip" style="width: 250px"></div></td>
						</tr>

						<tr>
							<td colspan="3" style="text-align: center"><a
								class="easyui-linkbutton" iconCls="icon-ok"
								onclick="$('#update_form').submit();">修改</a> <a
								class="easyui-linkbutton" iconCls="icon-cancel"
								onclick="$('#datagrid_update').window('close');">取消</a></td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>

	</div>
</body>
</html>